package com.butte.mound.admin.extend;

import com.butte.mound.frame.security.AuthCheck;
import com.butte.mound.shared.model.TbUser;
import com.butte.mound.shared.service.TbUserService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Slf4j
@Component
@RequiredArgsConstructor
public class AdminAuthCheck implements AuthCheck {

  private final TbUserService tbUserService;

  @Override
  public Boolean hasPermission(Long id, String... authCode) {

    log.info("id:{},authCode:{}",id,authCode);

    // 匹配用户权限
    TbUser user = tbUserService.getById(id);
    log.info("user-remark:{}",user.getRemark());

    return Boolean.TRUE;
  }
}
